<template>
  <div>
    我是子组件
    <p>{{ msg }}</p>
    <p>{{ count }}</p>
    <button @click="updateParent">子组件通知父组件修改数据</button>
  </div>
</template>

<script setup lang="ts">
const props: any = defineProps({
  // modelValue: String
  msg: String,
  count: Number
})
// const emits = defineEmits(['update:modelValue'])
const emits = defineEmits(['update:msg', 'update:count'])

const updateParent = () => {
  // emits('update:modelValue', props.modelValue + '-')
  emits('update:msg', props.msg + '-')
  emits('update:count', props.count + 1)
}
</script>
